package org.zxw.cms.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.zxw.basic.dao.impl.BaseDaoImpl;
import org.zxw.cms.dao.IRoleDao;
import org.zxw.cms.model.Role;

@Repository("roleDao")
public class RoleDaoImpl extends BaseDaoImpl<Role> implements IRoleDao {

	@Override
	public List<Role> listRole() {
		return this.list("from Role");
	}

	@Override
	public void deleteRoleUsers(int roleId) {
		String hql = "delete UserRole ur where ur.role.id=?";
		this.updateByHql(hql, roleId);
	}

}
